<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#Btn").click(function(){
		$.ajax({
			type : "post",
			url : "${initParam.root}/memberUpdateByPassword.do",
			data:$("#fform").serialize(),
			datatype:"json",
			success:function(data){
				
				if(data==false)
					{
						alert("변경 실패!!");
					}
				else if(data==true)
					{
						alert("변경되었습니다");
						window.opener.location.href="${initParam.root }/main.do";
						self.close();
					}
				
				
				
			}
		});
		event.preventDefault();
	});//submit
	
});
</script>
</head>
<body>

<c:choose>
<c:when test="${requestScope.map.method=='id' }">
<h1>아이디 검색 결과</h1>

<c:choose>
<c:when test="${requestScope.map.flag==false }">
<h1>검색 결과가 없습니다</h1>
</c:when>
<c:otherwise>
<c:forEach items="${requestScope.map.list}" var="list">
${list.id}
</c:forEach>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<h2>패스워드 찾기 결과</h2>
<c:choose>
<c:when test="${requestScope.map.flag==false}">
<h1>검색 결과가 없습니다</h1>
</c:when>
<c:otherwise>
<form id="fform">
변경할 비밀번호를 입력하시오<br>
<input type="hidden" name="id" value="${requestScope.map.mvo.id }">
Password : <input type= "password" id="password" name="password"><br>
<input id="Btn" type="button" value="확인">
</form>
</c:otherwise>
</c:choose>
</c:otherwise>
</c:choose>
</body>
</html>